#!/bin/sh

set -e

if [ ! -d /etc/connman/ ] ; then
        mkdir -p /etc/connman/ || true
fi

if [ -f /lib/systemd/system/connman.service ] ; then
        #Seeed WifiConfig
        unset check_connman
        check_connman=$(cat /lib/systemd/system/connman.service | grep ExecStart | grep nodnsproxy || true)
        if [ ! "x${check_connman}" = "x" ] ; then
                touch /etc/connman/service.set.nodnsproxy || true
        fi

        #NFS eth0
        unset check_connman
        check_connman=$(cat /lib/systemd/system/connman.service | grep ExecStart | grep eth0 || true)
        if [ ! "x${check_connman}" = "x" ] ; then
                touch /etc/connman/service.set.eth0 || true
        fi
fi

case "$1" in
        configure)
                if [ -x /usr/share/update-notifier/notify-reboot-required ]; then
                        /usr/share/update-notifier/notify-reboot-required
                fi
        ;;
esac

#DEBHELPER#
